package code.tools.behavior.achieve 
{
	import code.tools.behavior.IAppear;
	
	import com.greensock.TweenLite;
	
	import flash.display.Sprite;
	
	/**
	 * 逐渐变大
	 * @author CYang
	 */
	public class AppearAlpha implements IAppear
	{
		/**
		 * 面板引用
		 */
		private var _mPanel:Sprite;
		/**
		 * 面板出现后执行的操作
		 */
		private var _callBack:Function;
		/**
		 * 构造函数
		 * @param	_mPanel 面板
		 * @param	callback 执行函数
		 */
		public function AppearAlpha(_mPanel:Sprite, callback:Function = null)
		{
			this._mPanel = _mPanel;
			this._callBack = callback;
			_mPanel.visible = false;
			_mPanel.alpha = 0;
		}
		/**
		 * 出现
		 */
		public function appear():void
		{
			_mPanel.visible = true;
			TweenLite.to(_mPanel, 1, { alpha:1 } );
			if (_callBack != null) _callBack();
		}
//		
//		public function get setRegisterPoint():Boolean
//		{
//			return true;
//		}
	}

}